<%@page import="com.neiquan.backstage.pub.bsc.dao.po.User"%>
<%@page import="com.neiquan.backstage.user.UserService"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Notice"%>
<%@page import="com.neiquan.backstage.common.util.Sessions"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.AdminUser"%>
<%@page import="com.neiquan.backstage.notice.NoticeService"%>
<%@page import="java.util.List"%>
<%@page import="com.neiquan.backstage.common.CommonService"%>
<%@page import="com.neiquan.backstage.common.util.SpringContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
ApplicationContext appCtx = SpringContextUtils.getApplicationContext();
CommonService commonService = appCtx.getBean(CommonService.class);
NoticeService noticeService = appCtx.getBean(NoticeService.class);
HttpSession sessions=request.getSession();
User user=(User)Sessions.getLoginedUser(sessions);
List<Notice> noticeList=noticeService.queryAll(user.getMemberId());
pageContext.setAttribute("noticeList", noticeList);
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>我的工作台</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
</head>
<body bgcolor="#f0f0f0">
		<section>
			<section>
				<table class="classify common_bg tc" cellspacing="0" cellpadding="0">
					<tr>
					<%if(user.getType()==User.type_boss){ %>
						<td>
							<a href="mystation.jsp"><img src="img/work1.png" alt="" /></a>
							<p class="td-p">工位管理</p>
						</td>
						<%} %>
						<td>
							<a href="boardroom.jsp"><img src="img/work2.png" alt="" /></a>
							<p class="td-p">会议室预约</p>
						</td>
						<td class="no-line">
							<a href="addrvisitor.jsp?memberId=<%=user.getMemberId() %>"><img src="img/work3.png" alt="" /></a>
							<p class="td-p">场地参观</p>
						</td>
					</tr>
					<tr>
					<%if(user.getType()==User.type_boss){ %>
						<td>
							<a href="rentnone.jsp"><img src="img/work4.png" alt="" /></a>
							<p class="td-p">租金缴纳</p>
						</td>
						<%} %>
						<td>
							<a href="apply.jsp"><img src="img/work5.png" alt="" /></a>
							<p class="td-p">我的申请</p>
						</td>
						<%if(user.getType()==User.type_boss){ %>
						<td class="no-line">
							<a href="employeemanager.jsp"><img src="img/work6.png" alt="" /></a>
							<p class="td-p">员工管理</p>
						</td>
					</tr>
					<tr class="no-border">
						<td>
							<a href="entrepreneur_complete.jsp"><img src="img/work7.png" alt="" /></a>
							<p class="td-p">公司资料</p>
						</td>
						<%} %>
						<td>
							<a href="myinfo.jsp"><img src="img/work8.png" alt="" /></a>
							<p class="td-p">我的资料</p>
						</td>
						<td class="no-line">
						</td>
					</tr>
				</table>
			</section>
			<section class="notice common_bg">
				<section class="pd">
					<hgroup class="border_bottom">最新公告<a href="notiec.jsp?memberId=<%=user.getMemberId() %>" class="more fr">更多>></a></hgroup>
					<c:forEach var="notice" items="${pageScope.noticeList}">
						<a href="noticedetail.jsp?id=${notice.noticeId}">
							<p class="notice-detail">
								${notice.name}
								<time class="fr"><%=commonService.formatTimestamp(((Notice)pageContext.getAttribute("notice")).getDtCreat(),"yyyy-MM-dd")%></time>
							</p>
						</a>
					</c:forEach> 
				</section>	
			</section>
		</section>
</body>
<script src="js/responsive.js"></script>
</html>
